package com.kefu.robot.vo;

import java.util.List;

import javax.validation.constraints.NotEmpty;

import com.kefu.common.context.KefuContext;
import com.kefu.common.util.JacksonUtil;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.robot.model.RobotConnectRel;
import com.kefu.sys.model.SysGroup;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2021/11/23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "转人工关键词")
public class RobotConnectRelUpdateVo extends AbstractUpdateVo<RobotConnectRel,String> {

	@NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "机器人")
    private String robotId;

    @ApiModelProperty(value = "创建人姓名")
    private String createName;

    @ApiModelProperty(value = "更新人姓名")
    private String updateName;

    @ApiModelProperty(value = "匹配方式1=包含匹配，2=完全匹配")
    private Integer matchType;

    @ApiModelProperty(value = "转接方式1=遵循默认分配策略，2=转接给指定技能组,3=客户选择技能组")
    private Integer connectType;

    @ApiModelProperty(value = "转接排队类型 1=不触发排队，2=触发排队")
    private Integer connectWaitType;

    @ApiModelProperty(value = "转接提示内容")
    private String connectContent;

    @ApiModelProperty(value = "转接技能组集合(id+name)的json")
    private List<SysGroup> connectGroups;

    @Override
    public RobotConnectRel convert() {
        KefuContext context = KefuContext.getKefuContext();
        RobotConnectRel info = new RobotConnectRel();
        info.setTenantId(context.getTenantId());
        info.setCreateName(createName);
        info.setUpdateName(updateName);
        info.setMatchType(matchType);
        info.setConnectType(connectType);
        info.setConnectWaitType(connectWaitType);
        info.setConnectContent(connectContent);
        info.setId(id);
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        info.setConnectGroups(JacksonUtil.toString(connectGroups));
        return info;
	}
}